namespace GemBox.Spreadsheet
{
    using System;

    public sealed class ExcelViewOptions
    {
        private ExcelWorksheet parent;

        internal ExcelViewOptions(ExcelWorksheet parent)
        {
            this.parent = parent;
        }

        public int FirstVisibleColumn
        {
            get
            {
                return this.parent.firstVisibleColumn;
            }
            set
            {
                this.parent.firstVisibleColumn = value;
            }
        }

        public int FirstVisibleRow
        {
            get
            {
                return this.parent.firstVisibleRow;
            }
            set
            {
                this.parent.firstVisibleRow = value;
            }
        }

        public bool OutlineColumnButtonsRight
        {
            get
            {
                return this.parent.GetWSBoolOption(WSBoolOptions.ColGroupRight);
            }
            set
            {
                this.parent.SetWSBoolOption(value, WSBoolOptions.ColGroupRight);
            }
        }

        public bool OutlineRowButtonsBelow
        {
            get
            {
                return this.parent.GetWSBoolOption(WSBoolOptions.RowGroupBelow);
            }
            set
            {
                this.parent.SetWSBoolOption(value, WSBoolOptions.RowGroupBelow);
            }
        }

        public int PageBreakViewZoom
        {
            get
            {
                return this.parent.pageBreakViewZoom;
            }
            set
            {
                if ((value < 10) || (value > 400))
                {
                    throw new ArgumentOutOfRangeException("value", value, "PageBreakViewZoom must be in range from 10 to 400.");
                }
                this.parent.pageBreakViewZoom = value;
            }
        }

        public bool ShowColumnsFromRightToLeft
        {
            get
            {
                return this.parent.GetWindowOption(WorksheetWindowOptions.ColumnsFromRightToLeft);
            }
            set
            {
                this.parent.SetWindowOption(value, WorksheetWindowOptions.ColumnsFromRightToLeft);
            }
        }

        public bool ShowFormulas
        {
            get
            {
                return this.parent.GetWindowOption(WorksheetWindowOptions.ShowFormulas);
            }
            set
            {
                this.parent.SetWindowOption(value, WorksheetWindowOptions.ShowFormulas);
            }
        }

        public bool ShowGridLines
        {
            get
            {
                return this.parent.GetWindowOption(WorksheetWindowOptions.ShowGridLines);
            }
            set
            {
                this.parent.SetWindowOption(value, WorksheetWindowOptions.ShowGridLines);
            }
        }

        public bool ShowInPageBreakPreview
        {
            get
            {
                return this.parent.GetWindowOption(WorksheetWindowOptions.ShowInPageBreakPreview);
            }
            set
            {
                this.parent.SetWindowOption(value, WorksheetWindowOptions.ShowInPageBreakPreview);
            }
        }

        public bool ShowOutlineSymbols
        {
            get
            {
                return this.parent.GetWindowOption(WorksheetWindowOptions.ShowOutlineSymbols);
            }
            set
            {
                this.parent.SetWindowOption(value, WorksheetWindowOptions.ShowOutlineSymbols);
            }
        }

        public bool ShowSheetHeaders
        {
            get
            {
                return this.parent.GetWindowOption(WorksheetWindowOptions.ShowSheetHeaders);
            }
            set
            {
                this.parent.SetWindowOption(value, WorksheetWindowOptions.ShowSheetHeaders);
            }
        }

        public bool ShowZeroValues
        {
            get
            {
                return this.parent.GetWindowOption(WorksheetWindowOptions.ShowZeroValues);
            }
            set
            {
                this.parent.SetWindowOption(value, WorksheetWindowOptions.ShowZeroValues);
            }
        }

        public int Zoom
        {
            get
            {
                return this.parent.zoom;
            }
            set
            {
                if ((value < 10) || (value > 400))
                {
                    throw new ArgumentOutOfRangeException("value", value, "Zoom must be in range from 10 to 400.");
                }
                this.parent.zoom = value;
            }
        }
    }
}
